/*
 * DealAnimationThread.java
 *
 * Copyright(c) 2011 - Kimnach
 * See main.Main.java for full copyright notice.
 *
 */

package main.view.resources;

import main.view.MainFrame;

/**
 * Handles dealing initiatives and showing a visual indicator that it was dealt
 * @author dkimnach
 */
public class DealAnimationThread implements Runnable {

    private MainFrame callback;

    /**
     * Constructor
     * @param callback
     */
    public DealAnimationThread (MainFrame callback) {
        this.callback = callback;
    }

    @Override
    public void run () {
        callback.waitCursor();
        callback.getDriver().deal();
        callback.update();
        callback.updateCounters();
        callback.updateInitLabels();

        try { 
            Thread.sleep(250);
        }
        catch (InterruptedException ex) {
        }
        finally { 
            callback.doneCursor();
        }
    }
}
